Skip to content

Conversation

@amoeba
Copy link
Member

@amoeba amoeba commented Dec 12, 2025

Closes #230

@amoeba amoeba requested a review from zeroshade December 12, 2025 22:06
Comment on lines +13 to +22
userdir, err := os.UserConfigDir()
if err != nil {
return "", fmt.Errorf("failed to get dbc configuration directory: %v", err)
}

orgDirName := "columnar"
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
orgDirName = "Columnar"
}
dbcDirName := "dbc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but you were the one who said I should use XDG_DATA_HOME if it exists.... lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. 🤦 This still fixes the original issue that was reported. Let me think about it and I'll tweak this so it uses XDG_DATA_DIR on Linuxes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which would make this:

  • macOS + Windows: os.UserConfigDir()
  • Linux: check XDG_DATA_DIR, fallback to os.UserConfigDir()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be XDG_DATA_HOME, there is no XDG_DATA_DIR there is XDG_DATA_DIRS which is a list of paths

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and we should still check XDG_DATA_HOME on macOS too. According to Apple's docs, the equivalent for XDG_DATA_HOME on macOS is ~/Library/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that last bit I didn't know.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe my idea was bad, I'll think about it more when I'm back.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, that's why it was using the logic I laid out. which was separate from the XDG_CONFIG_HOME (os.UserConfigDir) heh

@zeroshade
Copy link
Member

Did we come to a consensus on this?

@amoeba
Copy link
Member Author

amoeba commented Jan 11, 2026

Did we come to a consensus on this?

I wasn't able to find anything solid to go off of. The only thing that recommends a dir like ~/Library/dbc is a random FAQ on Java: https://developer.apple.com/library/archive/qa/qa1170/_index.html. But it makes a point that aligns with how XDG does things: it's good practice to separate config from data. Is this the ref you are referring to when you say,

According to Apple's docs, the equivalent for XDG_DATA_HOME on macOS is ~/Library/...

I think I'm okay with closing this PR unmerged and keeping the current behavior.

@amoeba
Copy link
Member Author

amoeba commented Jan 12, 2026

I just created a PR with regression tests for the current credentials path behavior: #247.

@zeroshade zeroshade closed this Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rationalize locations where dbc configs are stored

2 participants